home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
misc
/
db3.6-beta
/
db3.6-beta-src
/
toolbox.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-11-30
|
16KB
|
349 lines
/* Images for the toolbox */
#include "toolbox.h"
#include "dbGUI.h"
#include <proto/intuition.h>
#define LATER 0
extern Class *TextFieldClass;
UWORD __chip CheckBoxIData[] =
{
/* Plane 0 */
0x0000,0x0000,0x0040,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x0000,0x0000,0x20C0,0x0000,0x0000,0x60C0,
0x0000,0x0000,0x60C0,0x0000,0x0000,0x60C0,0x0000,0x0078,
0x60C0,0x0000,0x00C0,0x60C0,0x0000,0x00C0,0x60C0,0x0000,
0x0180,0x60C0,0x0000,0x0180,0x60C0,0x0001,0xC300,0x60C0,
0x0000,0xC200,0x60C0,0x0000,0xE600,0x60C0,0x0000,0x6400,
0x60C0,0x0000,0x7C00,0x60C0,0x0000,0x3800,0x60C0,0x0000,
0x0000,0x60C0,0x0000,0x0000,0x60C0,0x0000,0x0000,0x60C0,
0x00FF,0xFFFF,0xE0C0,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x7FFF,0xFFFF,0xFFC0,
/* Plane 1 */
0xFFFF,0xFFFF,0xFF80,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0xC1FF,0xFFFF,0xC000,0xC180,0x0000,0x0000,
0xC180,0x0000,0x0000,0xC180,0x0000,0x0000,0xC180,0x0000,
0x0000,0xC180,0x0000,0x0000,0xC180,0x0000,0x0000,0xC180,
0x0000,0x0000,0xC180,0x0000,0x0000,0xC180,0x0000,0x0000,
0xC180,0x0000,0x0000,0xC180,0x0000,0x0000,0xC180,0x0000,
0x0000,0xC180,0x0000,0x0000,0xC180,0x0000,0x0000,0xC180,
0x0000,0x0000,0xC180,0x0000,0x0000,0xC180,0x0000,0x0000,
0xC100,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0x8000,0x0000,0x0000,
};
struct Image CheckBoxI =
{
0, 0, /* Upper left corner */
TBGadW, TBGadH, 2, /* Width, Height, Depth */
CheckBoxIData, /* Image data */
0x0003, 0x0000, /* PlanePick, PlaneOnOff */
NULL /* Next image */
};
UWORD __chip CycleIData[] =
{
/* Plane 0 */
0x0000,0x0000,0x0040,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x0000,0x0000,0x20C0,0x0000,0x0000,0x60C0,
0x0003,0xF810,0x60C0,0x0006,0x0C10,0x60C0,0x0006,0x0C10,
0x60C0,0x0006,0x3F10,0x60C0,0x0006,0x1E10,0x60C0,0x0006,
0x0C10,0x60C0,0x0006,0x0010,0x60C0,0x0006,0x0010,0x60C0,
0x0006,0x0010,0x60C0,0x0006,0x0010,0x60C0,0x0006,0x0010,
0x60C0,0x0006,0x0010,0x60C0,0x0006,0x0C10,0x60C0,0x0003,
0xF810,0x60C0,0x0000,0x0010,0x60C0,0x0000,0x0000,0x60C0,
0x00FF,0xFFFF,0xE0C0,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x7FFF,0xFFFF,0xFFC0,
/* Plane 1 */
0xFFFF,0xFFFF,0xFF80,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0xC1FF,0xFFFF,0xC000,0xC180,0x0000,0x0000,
0xC180,0x0008,0x0000,0xC180,0x0008,0x0000,0xC180,0x0008,
0x0000,0xC180,0x0008,0x0000,0xC180,0x0008,0x0000,0xC180,
0x0008,0x0000,0xC180,0x0008,0x0000,0xC180,0x0008,0x0000,
0xC180,0x0008,0x0000,0xC180,0x0008,0x0000,0xC180,0x0008,
0x0000,0xC180,0x0008,0x0000,0xC180,0x0008,0x0000,0xC180,
0x0008,0x0000,0xC180,0x0008,0x0000,0xC180,0x0000,0x0000,
0xC100,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0x8000,0x0000,0x0000,
};
struct Image CycleI =
{
0, 0, /* Upper left corner */
TBGadW, TBGadH, 2, /* Width, Height, Depth */
CycleIData, /* Image data */
0x0003, 0x0000, /* PlanePick, PlaneOnOff */
NULL /* Next image */
};
UWORD __chip StringIData[] =
{
/* Plane 0 */
0x0000,0x0000,0x0040,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x0000,0x0000,0x20C0,0x00FF,0xFFFF,0x60C0,
0x00C0,0x0000,0x60C0,0x00C0,0x0000,0x60C0,0x00C3,0xC400,
0x60C0,0x00C4,0x2400,0x60C0,0x00C4,0x0EA0,0x60C0,0x00C3,
0x04C0,0x60C0,0x00C0,0xC480,0x60C0,0x00C0,0x2480,0x60C0,
0x00C4,0x2480,0x60C0,0x00C4,0x2480,0x60C0,0x00C3,0xC680,
0x60C0,0x00C0,0x0000,0x60C0,0x00C0,0x0000,0x60C0,0x00C0,
0x0000,0x60C0,0x00C0,0x0000,0x60C0,0x0080,0x0000,0x60C0,
0x01FF,0xFFFF,0xE0C0,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x7FFF,0xFFFF,0xFFC0,
/* Plane 1 */
0xFFFF,0xFFFF,0xFF80,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0xC3FF,0xFFFF,0xC000,0xC300,0x0000,0x8000,
0xC300,0x0001,0x8000,0xC300,0x0001,0x8000,0xC300,0x0001,
0x8000,0xC300,0x0001,0x8000,0xC300,0x0001,0x8000,0xC300,
0x0001,0x8000,0xC300,0x0001,0x8000,0xC300,0x0001,0x8000,
0xC300,0x0001,0x8000,0xC300,0x0001,0x8000,0xC300,0x0001,
0x8000,0xC300,0x0001,0x8000,0xC300,0x0001,0x8000,0xC300,
0x0001,0x8000,0xC300,0x0001,0x8000,0xC37F,0xFFFF,0x8000,
0xC200,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0x8000,0x0000,0x0000,
};
struct Image StringI =
{
0, 0, /* Upper left corner */
TBGadW, TBGadH, 2, /* Width, Height, Depth */
StringIData, /* Image data */
0x0003, 0x0000, /* PlanePick, PlaneOnOff */
NULL /* Next image */
};
UWORD __chip TextIData[] =
{
/* Plane 0 */
0x0000,0x0000,0x0040,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x03FF,0xFFFF,0xC0C0,0x0300,0x0000,0x00C0,
0x0300,0x0000,0x00C0,0x0300,0x0000,0x00C0,0x0300,0x0000,
0x00C0,0x033F,0x8010,0x00C0,0x0304,0x0010,0x00C0,0x0304,
0x2138,0x00C0,0x0304,0x1210,0x00C0,0x0304,0x0C10,0x00C0,
0x0304,0x0C10,0x00C0,0x0304,0x1210,0x00C0,0x0304,0x2110,
0x00C0,0x0304,0x2118,0x00C0,0x0300,0x0000,0x00C0,0x0300,
0x0000,0x00C0,0x0300,0x0000,0x00C0,0x0300,0x0000,0x00C0,
0x0200,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x7FFF,0xFFFF,0xFFC0,
/* Plane 1 */
0xFFFF,0xFFFF,0xFF80,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0xC000,0x0000,0x2000,0xC000,0x0000,0x6000,
0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,
0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,
0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,
0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,
0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,
0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,
0xC1FF,0xFFFF,0xE000,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0x8000,0x0000,0x0000
};
struct Image TextI =
{
0, 0, /* Upper left corner */
TBGadW, TBGadH, 2, /* Width, Height, Depth */
TextIData, /* Image data */
0x0003, 0x0000, /* PlanePick, PlaneOnOff */
NULL /* Next image */
};
UWORD __chip TextFieldIData[] =
{
/* Plane 0 */
0x0000,0x0000,0x0040,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x03FF,0xFFFF,0xC0C0,0x0300,0x0000,0x00C0,
0x0300,0x0000,0x00C0,0x033E,0x0010,0x00C0,0x0308,0x0010,
0x00C0,0x0308,0x64B8,0x00C0,0x0308,0xB310,0x00C0,0x0308,
0x8310,0x00C0,0x0308,0x6488,0x00C0,0x0300,0x0000,0x00C0,
0x033E,0x0010,0x00C0,0x0308,0x0010,0x00C0,0x0308,0x64B8,
0x00C0,0x0308,0xB310,0x00C0,0x0308,0x8310,0x00C0,0x0308,
0x6488,0x00C0,0x0300,0x0000,0x00C0,0x0300,0x0000,0x00C0,
0x0200,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,
0x00C0,0x0000,0x0000,0x00C0,0x0000,0x0000,0x00C0,0x0000,
0x0000,0x00C0,0x7FFF,0xFFFF,0xFFC0,
/* Plane 1 */
0xFFFF,0xFFFF,0xFF80,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0xC000,0x0000,0x2000,0xC000,0x0000,0x6000,
0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,
0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,
0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,
0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,
0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,
0x0000,0x6000,0xC000,0x0000,0x6000,0xC000,0x0000,0x6000,
0xC1FF,0xFFFF,0xE000,0xC000,0x0000,0x0000,0xC000,0x0000,
0x0000,0xC000,0x0000,0x0000,0xC000,0x0000,0x0000,0xC000,
0x0000,0x0000,0x8000,0x0000,0x0000
};
struct Image TextFieldI =
{
0, 0, /* Upper left corner */
TBGadW, TBGadH, 2, /* Width, Height, Depth */
TextFieldIData, /* Image data */
0x0003, 0x0000, /* PlanePick, PlaneOnOff */
NULL /* Next image */
};
struct Gadget ToolBoxGadgets[] = {
{
/* CHECKBOX */
NULL, LATER, LATER,
TBGadW, TBGadH,
GFLG_GADGHCOMP|GFLG_GADGIMAGE, /* Flags */
GACT_RELVERIFY, /* Activation */
GTYP_BOOLGADGET, /* GadgetType */
&CheckBoxI, /* GadgetRender */
NULL, /* SelectRender */
NULL, /* GadgetText */
0, /* MutualExclude */
NULL, /* SpecialInfo */
CheckBoxID, /* GadgetID */
NULL /* UserData */
},
{
/* CYCLE */
&ToolBoxGadgets[CheckBoxID], LATER, LATER,
TBGadW, TBGadH,
GFLG_GADGHCOMP|GFLG_GADGIMAGE, /* Flags */
GACT_RELVERIFY, /* Activation */
GTYP_BOOLGADGET, /* GadgetType */
&CycleI, /* GadgetRender */
NULL, /* SelectRender */
NULL, /* GadgetText */
0, /* MutualExclude */
NULL, /* SpecialInfo */
CycleID, /* GadgetID */
NULL /* UserData */
},
{
/* STRING */
&ToolBoxGadgets[CycleID], LATER, LATER,
TBGadW, TBGadH,
GFLG_GADGHCOMP|GFLG_GADGIMAGE, /* Flags */
GACT_RELVERIFY, /* Activation */
GTYP_BOOLGADGET, /* GadgetType */
&StringI, /* GadgetRender */
NULL, /* SelectRender */
NULL, /* GadgetText */
0, /* MutualExclude */
NULL, /* SpecialInfo */
StringID, /* GadgetID */
NULL /* UserData */
},
{
/* TEXT */
&ToolBoxGadgets[StringID], LATER, LATER,
TBGadW, TBGadH,
GFLG_GADGHCOMP|GFLG_GADGIMAGE, /* Flags */
GACT_RELVERIFY, /* Activation */
GTYP_BOOLGADGET, /* GadgetType */
&TextI, /* GadgetRender */
NULL, /* SelectRender */
NULL, /* GadgetText */
0, /* MutualExclude */
NULL, /* SpecialInfo */
TextID, /* GadgetID */
NULL /* UserData */
},
{
/* TEXTFIELD */
&ToolBoxGadgets[TextID], LATER, LATER,
TBGadW, TBGadH,
GFLG_GADGHCOMP|GFLG_GADGIMAGE, /* Flags */
GACT_RELVERIFY, /* Activation */
GTYP_BOOLGADGET, /* GadgetType */
&TextFieldI, /* GadgetRender */
NULL, /* SelectRender */
NULL, /* GadgetText */
0, /* MutualExclude */
NULL, /* SpecialInfo */
TextFieldID, /* GadgetID */
NULL /* UserData */
}
};
void CloseToolBox(struct Window *win)
{
CloseWindow(win);
}
struct Window *OpenToolBox(struct Window *parent)
{
struct Window *win;
ToolBoxGadgets[StringID].LeftEdge = OffX;
ToolBoxGadgets[StringID].TopEdge = OffY;
ToolBoxGadgets[TextID].LeftEdge = OffX;
ToolBoxGadgets[TextID].TopEdge = OffY + 1*TBGadH;
ToolBoxGadgets[TextFieldID].LeftEdge = OffX;
ToolBoxGadgets[TextFieldID].TopEdge = OffY + 2*TBGadH;
/* Disable TextField is needed */
if(!TextFieldClass)
{
ToolBoxGadgets[TextFieldID].Flags |= GFLG_DISABLED;
}
ToolBoxGadgets[CycleID].LeftEdge = OffX;
ToolBoxGadgets[CycleID].TopEdge = OffY + 3*TBGadH;
ToolBoxGadgets[CheckBoxID].LeftEdge = OffX;
ToolBoxGadgets[CheckBoxID].TopEdge = OffY + 4*TBGadH;
win = OpenWindowTags( NULL,
WA_Left, parent->LeftEdge + parent->Width+32,
WA_Top, parent->TopEdge,
WA_Width, OffX + TBGadW + Scr->WBorRight,
WA_Height, OffY + 5*TBGadH + Scr->WBorBottom,
WA_IDCMP, IDCMP_GADGETUP,
WA_Flags, WFLG_NEWLOOKMENUS|WFLG_RMBTRAP|WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_SMART_REFRESH,
WA_Gadgets, &ToolBoxGadgets[TextFieldID],
WA_ScreenTitle, parent->ScreenTitle,
WA_PubScreen, Scr,
TAG_DONE );
return win;
}